﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Text;

namespace AnChao.WPF.Controls.Prism.ViewModels
{
    public class MockViewModel : DomainObject
    {
        private int _myProperty;
        public int MyProperty
        {
            get { return _myProperty; }
            set
            {
                SetProperty(ref _myProperty, value);

                if (value < 0)
                {
                    ErrorsContainer.SetErrors(() => MyProperty, new string[] { "value cannot be than 0" });
                }
                else
                {
                    ErrorsContainer.ClearErrors(() => MyProperty);
                }
            }
        }

       
    }
}
